package com.yfp.auth.form;

import com.yfp.auth.valid.LoginValidGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;


/**
 * 用户登录对象
 *
 * @author ruoyi
 */
@Data
@Tag(name = "用户登录", description = "用户登录交互载体")
public class LoginBody {

    /**
     * 用户名
     */
    private String username;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空", groups = {LoginValidGroup.Captcha.class, LoginValidGroup.CaptchaLogin.class, LoginValidGroup.PasswordLogin.class, LoginValidGroup.ResetPassword.class})
    @Schema(description = "手机号")
    private String phone;

    /**
     * 用户密码
     */
    @NotBlank(message = "用户密码不能为空-Rsa加密后的密码", groups = {LoginValidGroup.PasswordLogin.class})
    @Schema(description = "用户密码")
    private String password;

    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空", groups = {LoginValidGroup.CaptchaLogin.class, LoginValidGroup.ResetPassword.class})
    @Schema(description = "验证码")
    private String captcha;

    /**
     * 浏览器的唯一标识符，用于校验是否首次才该浏览器登录
     */
    @NotBlank(message = "浏览器唯一标识不能为空", groups = {LoginValidGroup.CaptchaLogin.class})
    @Schema(description = "浏览器唯一标识")
    private String visitorId;

    /**
     * 短信验证码
     */
    private String smsCode;
}
